// get the client
const mysql = require('mysql2');

// create the connection to database
const connection = mysql.createConnection({
  host: '10.10.3.15',
  user: 'xoops_root',
  password: 'jzw&oa',
  database: 'dp_test'
});

// execute will internally call prepare and query
connection.execute(
  'select * from alert a',
  function(err, results, fields) {
    console.log(results); // results contains rows returned by server
    console.log(fields); // fields contains extra meta data about results, if available

    // If you execute same statement again, it will be picked from a LRU cache
    // which will save query preparation time and give better performance
  }
);